<template>
	<view class="my-settle-container">
		
		<label class="radio">
			<radio @click="changeFullCheckState" color="#C00000" value="" :checked="isFullCheck"/><text>全选</text>
		</label>
		
		<view class="amount-box">
			合计: <text class="amount">¥{{totalPrice}}</text>
		</view>
		
		<view class="btn-settle">
			结算({{checkedCount}})
		</view>
	</view>
</template>

<script>
	import {mapGetters,mapMutations} from 'vuex'
	export default {
		name:"my-settle",
		data() {
			return {
				// isCheckAll:this.total === this.checkedCount
			};
		},
		computed: {
			...mapGetters('m_cart',['checkedCount','total','totalPrice']),
			isFullCheck() {
				return this.total === this.checkedCount;
			}
			
		},
		methods: {
			...mapMutations('m_cart',['uncheckGoods']),
			
			changeFullCheckState() {
				console.log(this.isFullCheck);
				this.uncheckGoods(!this.isFullCheck);
			}
		}
	}
</script>

<style lang="scss">
	.my-settle-container {
		position: fixed;
		bottom: 0;
		height: 50px;
		background-color: #FFFFFF;
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 14px;
		padding-left: 10px;
		border-top: 0.5px solid #C0C0C0;
	}
	.btn-settle {
		height: 100%;
		padding: 0 10px;
		text-align: center;
		box-sizing: content-box;
		line-height: 50px;
		color: #FFFFFF;
		background-color: #C00000;
		min-width: 100px;
	}
	.amount-box {
		.amount {
			color: #C00000;
			font-weight: bold;
		}
	}
	.radio {
		display: flex;
		align-items: center;
	}
</style>
